package com.chainyoung.trademarket.mvp.model;

import com.chainyoung.common.bean.UserInfo;
import com.chainyoung.common.di.scope.ActivityScope;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.trademarket.api.MainService;
import com.chainyoung.trademarket.mvp.contract.RegisterContract;

import java.util.TreeMap;

import javax.inject.Inject;

import dagger.Provides;
import io.reactivex.Flowable;

@ActivityScope
public class RegisterModel extends SendCodeModel implements RegisterContract.Model {




    @Inject
    public RegisterModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public Flowable<UserInfo> getRegiseter(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(MainService.class)
                .getRegister(map)
                .compose(RxUtils.<UserInfo>handleResult());
    }




}
